﻿using MapleLeaf.Pay;
using System;
using System.Collections.Generic;
using System.Text;

namespace Hongsh.Pay.Client.Proxy.Http {
    // Token: 0x02000034 RID: 52
    public class GClass0 : HttpTextResult {
        // Token: 0x1700009C RID: 156
        // (get) Token: 0x06000176 RID: 374 RVA: 0x000030A9 File Offset: 0x000012A9
        public string Root { get; }

        // Token: 0x1700009D RID: 157
        // (get) Token: 0x06000177 RID: 375 RVA: 0x000030B1 File Offset: 0x000012B1
        public object Content { get; }

        // Token: 0x1700009E RID: 158
        // (get) Token: 0x06000178 RID: 376 RVA: 0x0000BC70 File Offset: 0x00009E70
        public override string Text {
            get {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.AppendFormat("<{0}>", Root);
                IDictionary<string, object> dictionary = Content.ToDictionary<object>();
                foreach (KeyValuePair<string, object> keyValuePair in dictionary) {
                    stringBuilder.AppendFormat("<{0}><![CDATA[{1}]]></{0}>", keyValuePair.Key, keyValuePair.Value);
                }
                stringBuilder.AppendFormat("</{0}>", Root);
                return stringBuilder.ToString();
            }
        }

        // Token: 0x06000179 RID: 377 RVA: 0x000030B9 File Offset: 0x000012B9
        public GClass0(object content, string root) : this(Encoding.UTF8, content, root) {
            //Class15.cwcZ3SWztHroi();
            //this..ctor(Encoding.UTF8, content, root);
        }

        // Token: 0x0600017A RID: 378 RVA: 0x000030CD File Offset: 0x000012CD
        public GClass0(Encoding encoding, object content, string root) : base(encoding, null, "text/xml") {
            //Class15.cwcZ3SWztHroi();
            //base..ctor(encoding, null, "text/xml");
            Root = root;
            Content = content;
        }
    }
}
